import request from '@/config/axios'

// 规则详情 VO
export interface RuleDetailVO {
  id: number // 编号
  groupId: number // 规则ID
  name: string // 姓名
  level: number // 等级:1:高风险,2:中风险,3:低风险
  description: string // 描述
  version: number // 版本号
}

// 规则详情 API
export const RuleDetailApi = {
  // 查询规则详情分页
  getRuleDetailPage: async (params: any) => {
    return await request.get({ url: `/law/rule-detail/page`, params })
  },

  // 查询规则详情详情
  getRuleDetail: async (id: number) => {
    return await request.get({ url: `/law/rule-detail/get?id=` + id })
  },

  // 新增规则详情
  createRuleDetail: async (data: RuleDetailVO) => {
    return await request.post({ url: `/law/rule-detail/create`, data })
  },

  // 修改规则详情
  updateRuleDetail: async (data: RuleDetailVO) => {
    return await request.put({ url: `/law/rule-detail/update`, data })
  },

  // 删除规则详情
  deleteRuleDetail: async (id: number) => {
    return await request.delete({ url: `/law/rule-detail/delete?id=` + id })
  },

  // 导出规则详情 Excel
  exportRuleDetail: async (params) => {
    return await request.download({ url: `/law/rule-detail/export-excel`, params })
  }
}